package rmi;

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

public class server {
    public static void main(String[] args) {
       try {
           String serverName = "calculator";
           String serverIP = "127.0.0.1";
           int port = 1999;
           BookManage engine = new bookManageImpl();
           BookManage skeleton = (BookManage) UnicastRemoteObject.exportObject(engine, 0);
           LocateRegistry.createRegistry(port);
           Registry registry = LocateRegistry.getRegistry(serverIP, port);
           registry.rebind(serverName, skeleton);
       }
       catch (Exception e){
           System.out.println(e.getMessage());
       }
    }
}
